﻿<?xml version="1.0" encoding="utf-8" ?>

<hibernate-mapping
  xmlns="urn:nhibernate-mapping-2.2"
  namespace="MoroMoro.Samples.ToDoList.Domain.Categories"
  assembly="MoroMoro.Samples.ToDoList.Domain"
  default-lazy="false">

    <class name="Category" table="Categories" dynamic-update="true" optimistic-lock="all">
        <id name="PrimaryKey" column="CategoryPrimaryKey">
            <generator class="guid.comb" />
        </id>
        <property name="Name" not-null="true" length="100" unique="true" index="true" />
        <set name="ToDos" lazy="true" cascade="all" optimistic-lock="false" inverse="true">
            <key column="CategoryPrimaryKey" foreign-key="Category_ToDos" not-null="false" />
            <one-to-many class="MoroMoro.Samples.ToDoList.Domain.ToDos.ToDo" />
        </set>
    </class>
    
</hibernate-mapping>